package components.utils
{
	public class StringUtil
	{
		public static function isEmpty(str:String):Boolean
		{
			return str=="" || str==null;
		}
		
		/**
		 *替换字符串 
		 * @param str
		 * @param res
		 * @return 
		 * 
		 */		
		public static  function formatString(str:String, ...res):String
		{
			if(str==null)
				return ""; 
			
			for(var i:uint=0;i<res.length;i++)
			{
				str=str.replace(new RegExp("\\{"+i+"\\}", "g"),res[i]);
			}
			return str;
		}
	}
}